# -*- coding: utf-8 -*-
# @Time    : 2021/9/15 23:53
# @Author  : BrandonGT
# @FileName: 10_4_guest_book.py

prompt_guest = "Please enter your name: "
file_path = r"guest_book.txt"

while True:
    print("Enter 'q' at any time to quit")
    guest_name = input(prompt_guest)
    if guest_name == "q":
        break

    greeting_msg = f"Hello, {guest_name}"
    print(greeting_msg)

    record_msg = f"{guest_name} had visited\n"
    with open(file_path, "a") as file_object:
        file_object.write(record_msg)

